<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ page import="com.point.business.database.model.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Administrator console</title>
<link rel="icon" type="img/ico" href="images/icons/favicon.ico">
<jsp:include page="/loadResources.jsp" />
</head>
<script>
var contextPath = '<%=request.getContextPath()%>';
$(document).keypress(function(e) { 
    if (e.keyCode == 27) { 
        $('#dlg').dialog('close');
    } 
});
</script>
<body id="page1">
	<div class="bg">
		<div class="main">
			<header> <jsp:include page="/header.jsp" />
			<div class="row-2-1">
				<nav>
				<ul class="tabMenu">
					<li><a class="active" href="admin.jsp">Корисници</a></li>
					<li><a href="upload.jsp">Прикачи датотека</a></li>
					<li><a href="statistics.jsp">Статистики</a></li>
					<!--	<li><a href="products.html">Our Products</a></li>
						<li class="last-item"><a href="contacts.html">Contact Us</a></li> -->
				</ul>
				</nav>
			</div>
			</header>
			<section id="content">
			<div class="padding">
				<div class="box-bg">
					<div class="wrapper">
						<table id="tt" class="easyui-datagrid"
							style="width: 994px; height: 400px"
							url="${pageContext.request.contextPath}/servlet/AllUsersServlet"
							title="Корисници" rownumbers="true"
							toolbar="#toolbar" nowrap="false" autoRowHeight="true" fitColumns="true" singleSelect="true">
							<thead>
								<tr>
									<th field="fullName" width="150">Име</th>
									<th field="username" width="150">Корисничко име</th>
									<th field="email" width="180" align="right">Електронска пошта</th>
									<th field="company" width="150" align="right">Компанија</th>
									<!-- <th field="address" width="180" align="right">Адреса</th> -->
									<th field="city" width="120" align="right">Град</th>
									<th field="telephone" width="130" align="right">Телефон</th>
									<th field="cellPhone" width="130" align="right">Мобилен</th>
									<th field="maxSearchQueries" width="90" align="right">Максимум пребарувања</th>
									<!-- <th field="canDoSL" width="100" align="right">Пристап до SL</th>
									<th field="canDoNO" width="100" align="right">Пристап до NO</th>
									<th field="canDoND" width="100" align="right">Пристап до ND</th> -->
									<!-- <th field="creationDate" width="140" align="right">Датум
										на регистрација</th> -->
								</tr>
							</thead>
						</table>
						<div id="toolbar">
							<a href="#" class="easyui-linkbutton" iconCls="icon-add"
								plain="true" onclick="newUser()">Додади корисник</a> <a href="#"
								class="easyui-linkbutton" iconCls="icon-edit" plain="true"
								onclick="editUser()">Промени податоци</a> <a href="#"
								class="easyui-linkbutton" iconCls="icon-remove" plain="true"
								onclick="destroyUser()">Избриши корисник</a>
						</div>
						<div id="dlg" class="easyui-dialog" modal="true"
							style="width: 450px; height: 570px; padding: 10px 20px"
							closed="true" buttons="#dlg-buttons">
							<div class="ftitle margin-bottom-15 result-content-header">Информации за
								корисникот</div>
							<form id="fm" method="post">
								<div class="fitem height-32">
									<label class="input-dialog-admin">Име и презиме:</label> <input
										name="fullName" class="easyui-validatebox" required="true">
								</div>
								<div class="fitem height-32">
									<label class="input-dialog-admin">Корисничко име:</label> <input
										name="username" class="easyui-validatebox" required="true">
								</div>
								<div class="fitem height-32">
									<label class="input-dialog-admin">Лозинка:</label> <input type="password"
										name="password" class="easyui-validatebox" required="true">
								</div>
								<div class="fitem height-32">
									<label class="input-dialog-admin">Email:</label> <input
										name="email" class="easyui-validatebox" validType="email" required="true">
								</div>
								<div class="fitem height-32">
									<label class="input-dialog-admin">Компанија:</label> <input
									 name="company" class="easyui-validatebox">
								</div>
								<div class="fitem height-32">
									<label class="input-dialog-admin">Адреса:</label> <input
										 name="address"class="easyui-validatebox">
								</div>
								<div class="fitem height-32">
									<label class="input-dialog-admin">Град:</label> <input
										 name="city" class="easyui-validatebox">
								</div>
								<div class="fitem height-32">
									<label class="input-dialog-admin">Телефон:</label> <input
										type="number" name="telephone" class="easyui-validatebox">
								</div>
								<div class="fitem height-32">
									<label class="input-dialog-admin">Мобилен:</label> <input
										type="number" name="cellPhone" class="easyui-validatebox">
								</div>
								<div class="fitem height-32">
									<label class="input-dialog-admin">Максимум дневни пребарувања:</label> <input
										type="number" name="maxSearchQueries" class="easyui-validatebox">
								</div>
								<div class="fitem height-32">
									<label class="input-dialog-admin">Моментален број на пребарувања:</label> <input
										name="queriesCount" class="easyui-validatebox" disabled>
								</div>
								<div class="fitem height-32">
									<input type="checkbox" name="canDoSL">Пребарување во SL<br>
								</div>
								<div class="fitem height-32">
									<input type="checkbox" name="canDoNO" >Пребарување во NO<br>
								</div>
								<div class="fitem height-32">
									<input type="checkbox" name="canDoND">Пребарување во ND<br>
								</div>
								<div class="fitem height-32">
									<input type="checkbox" name="canDoUOPB">Пребарување во UOPB<br>
								</div>
							</form>
						</div>
						<div id="dlg-buttons">
							<a href="#" class="easyui-linkbutton" iconCls="icon-ok"
								onclick="saveUser()">Зачувај</a> <a href="#"
								class="easyui-linkbutton" iconCls="icon-cancel"
								onclick="javascript:$('#dlg').dialog('close')">Затвори</a>
						</div>
					</div>
				</div>
			</div>
			</section>
			<footer> <jsp:include page="/footer.jsp" /> </footer>
		</div>
	</div>
</body>
</html>